﻿using SharePointUtilitiesForDevelopers.Mapper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;

namespace SharePointUtilitiesForDevelopers.Tests.Repository
{
    /// <summary>
    ///Test class for <see cref="SharePointMapperException{TFrom,TTo}"/>.
    ///</summary>
    [TestClass]
    public class SharePointServiceResponseMapperExceptionTest
    {
        [TestMethod]
        public void SharePointServiceResponseMapperException_constructor_sets_default_values()
        {
            Exception innerException = new FormatException("This is a unit test format exception message.");
            var target = new SharePointMapperException<string, int>(innerException);
            Assert.AreEqual(innerException, target.InnerException);
            Assert.AreEqual("Failed to map type 'System.String' to 'System.Int32'.", target.Message);
        }
    }
}